package com.xiaoergekeji.cloud.devops.scheduler.api;

import com.xiaoergekeji.cloud.core.common.http.JsonResult;
import com.xiaoergekeji.cloud.core.common.http.PageVO;
import com.xiaoergekeji.cloud.devops.scheduler.bean.dto.JobDTO;
import com.xiaoergekeji.cloud.devops.scheduler.bean.qo.TaskLogQO;
import com.xiaoergekeji.cloud.devops.scheduler.bean.vo.TaskInfoVO;
import com.xiaoergekeji.cloud.devops.scheduler.bean.vo.TaskLogVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: xeg-cloud
 * @description:
 * @author: ArchieDing
 * @create: 2021-05-19 23:19
 **/
@FeignClient(name = "devops-scheduler", path = "/feign/scheduler", contextId = "scheduler")
public interface SchedulerFeignService {
    @PostMapping("/addJob")
    JsonResult<Boolean> addJob(@RequestBody JobDTO dto);

    @PostMapping("/editJob")
    JsonResult<Boolean> editJob(@RequestBody JobDTO dto);

    @PostMapping("/deleteJob")
    JsonResult<Boolean> deleteJob(@RequestParam(name = "jobName") String jobName);

    @PostMapping("/startJob")
    JsonResult<Boolean> startJob(@RequestParam(name = "jobName") String jobName);

    @PostMapping("/pauseJob")
    JsonResult<Boolean> pauseJob(@RequestParam(name = "jobName") String jobName);

    @PostMapping("/resumeJob")
    JsonResult<Boolean> resumeJob(@RequestParam(name = "jobName") String jobName);

    @GetMapping("/getTaskInfoList")
    JsonResult<List<TaskInfoVO>> getTaskInfoList();

    @PostMapping("/pageTaskLog")
    JsonResult<PageVO<TaskLogVO>> pageTaskLog(@RequestBody TaskLogQO qo);
}
